Store and confirm what experiments a user is enrolled in #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Day One iOS right now we are looking to be able to have experiments that are only for new users. We had been verifying this by using a locally stored and calculated array of the experiments that a user is enrolled in or qualified for. This has a few issues with it, namely the potential for getting out of sync with what experiments ExPlat thinks a user is enrolled in, and has caused a bug where new user only experiments are being shown to existing users.
This PR is part of the process to fix that bug. With these changes, when we refresh the experiments I am storing the experiments names that are returned from the server and making that accessible outside of the package to confirm if a user is enrolled for a specific experiment. We need to store this separately because the server returns the name of the experiment for all enrolled experiments as a key and what the user is assigned to as a value. If the user is in the control group it returns null, and the existing ab-testing-assignments dictionary ignores the pairs with null as a value.
I chose to store the values in a separate array rather than change ab-testing-assignments to store the keys even if nothing was returned to avoid creating any potential issues with other apps that are using the experiments values.
With these changes we will be able to more accurately confirm what experiments a user participating in